<!-- BEGIN:main -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<link rel="stylesheet" href="templates/default/css/styles.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="templates/default/css/jquery.mobile-1.3.1.min.css" />
<script type="text/javascript" src="templates/default/javascript/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="templates/default/javascript/jquery.mobile-1.3.1.min.js"></script>
<script type="text/javascript" src="templates/default/javascript/libraries.js"></script>


<script type="text/javascript">
    /**
     * Xoá form
     */
    function clearForm() {
        $('#txtPassword').val("");
        $('#txtUsername').val("");
    }
    function submitForm(action) {
        var username = $('#txtUsername');
        var password = $('#txtPassword');//
        var arrayInput = new Array(username, password);
        var hasError = validateEmptyValue(arrayInput);
        if (!hasError) {
            var dataString = 'hdAction=' + action;
            dataString += '&txtUsername=' + username.val();
            dataString += '&txtPassword=' + password.val();
            $.ajax({
                url: '',
                type: "POST",
                data: dataString,
                cache: false,
                success: function(data) {
                    if (data.trim() == 'OK') {
                        window.location.reload();
                    } else {
                        alert('Sai thông tin đăng nhập vui lòng thử lại');
                    }
                }
            });
        } else {
            alert('Vui lòng điền đầy đủ dữ liệu');
        }
    }
</script>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<div data-role="page" id="home">  
    <div data-position="fixed" data-role="header" data-theme="b">  
        <p align="center">QUẢN LÝ BẾP CƠM  </p>
    </div>  
    <div data-role="content" >  
        <h1>Đăng nhập</h1>        
        <form action="" id="frmLogin" name="frmLogin"  method="post" >  
            <input type="hidden" name="hdAction" id="hdAction" value=""/>
            <div data-role="fieldcontain">  
                <label for="url" style=" width:150px;display: inline-block; ">Tài khoản(*):</label>
                <input class="required" id="txtUsername" name="txtUsername" type="text" value="">            
            </div>  
            <div data-role="fieldcontain">  
                <label for="url" style=" width:150px;display: inline-block; ">Mật khẩu(*):</label> 
                <input id="txtPassword" name="txtPassword" type="password" value="">            
            </div>             
                <fieldset class="ui-grid-a">                     
                    <div class="ui-block-a">  
                        <a href="javascript:void()"  data-ajax="false" data-role="button" data-theme="b" onclick="submitForm('login');">Đăng nhập</a>
                    </div>  
                    <div class="ui-block-b">  
                        <a href=""  data-ajax="false" data-role="button" data-theme="b" onclick="clearForm();" >Xoá</a>
                    </div> 
                </fieldset>            
        </form>  
    </div>  
</div> 
<script type="text/javascript" src="templates/default/javascript/jquery.js"></script>
<script type="text/javascript" src="templates/default/javascript/jquery.mobile-1.0rc1.min.js"></script>
<!-- END:main -->